package com.abo.yaas.webservice.hibernate;

import java.io.Serializable;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

@SuppressWarnings("serial")
public class EMF implements Serializable {
    private static EntityManagerFactory instance = null;

    public static void close() {
        if (instance != null) {
            instance.close();
        }
    }

    public static EntityManagerFactory get() {
        if (instance == null) {
            instance = Persistence.createEntityManagerFactory("persistenceUnit");
        }
        return instance;
    }
}
